package com.qf.qfcenterservice.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyBatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor interceptors(){
        MybatisPlusInterceptor interceptors = new MybatisPlusInterceptor();

        PaginationInnerInterceptor pageInterceptor = new PaginationInnerInterceptor();
        //错误页码的修复
        pageInterceptor.setOverflow(true);
        interceptors.addInnerInterceptor(pageInterceptor);

        return interceptors;
    }
}
